package com.heyu.cgsd.util;

public class WeightConvertUtils {
    private static final int G = 0;
    private static final int T = 1;
    private static final int KG = 2;
    private static final int MG = 3;
    private static final int UG = 4;
    private static final int Q = 5;
    private static final int LB = 6;
    private static final int OZ = 7;
    private static final int CT = 8;
    private static final int GR = 9;
    private static final int LT = 10;
    private static final int SHT = 11;
    private static final int CWT1 = 12;
    private static final int CWT2 = 13;
    private static final int UKST = 14;
    private static final int DR = 15;
    private static final int DAN = 16;
    private static final int JIN = 17;
    private static final int QIAN = 18;
    private static final int LIANG = 19;

    private static double[] c = {1, 1000000, 1000, 0.001, 0.000001, 100000, 453.59237,
            28.3495231, 0.2, 0.06479891, 1016046.91, 907184.74, 50802.3454, 45359.237,
            6350.29318, 1.7718452, 50000, 500, 5, 50};

    public static double convert(double input, int srcUnit, int desUnit) {
        double result = input * c[srcUnit];

        return result / c[desUnit];
    }
}
